package org.jetnuke.dao.sqlserver;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.List;

import net.jforum.JForumExecutionContext;
import net.jforum.util.preferences.SystemGlobals;

import org.jetnuke.dao.generic.GenericPictureCommentDAO;

public class SqlServerPictureCommentDAO extends GenericPictureCommentDAO {

	public List selectLastComments(int limit) throws Exception {
		String q1 = SystemGlobals.getSql("GenericModel.selectByLimit");
		String q2=SystemGlobals.getSql("PictureCommentModel.selectLastComments");
		PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(q1+" "+limit+" "+q2);
		ResultSet rs = p.executeQuery();
		List list = this.processSelectAll(rs);
		rs.close();
		p.close();
		
		return list;
	}

}
